<div class="headbar">
	<div class="position"><span>会员</span><span>></span><span>商户管理</span><span>></span><span>商户消息</span></div>
	<div class="operating">
		<a href="javascript:void(0)" onclick="sendMessage();"><button class="operating_btn" type="button"><span class="send">发信</span></button></a>
		<a href="javascript:void(0)" onclick="selectAll('check[]')"><button class="operating_btn" type="button"><span class="sel_all">全选</span></button></a>
		<a href="javascript:void(0)" onclick="delModel({form:'seller_message_list',msg:'确定要删除选中的记录吗？'})"><button class="operating_btn" type="button"><span class="delete">批量删除</span></button></a>
	</div>
</div>

<form action="{url:/comment/seller_message_del}" method="post" name="seller_message_list" onsubmit="return checkboxCheck('check[]','尚未选中任何记录！')">
<div class="content">
	<table id="list_table" class="list_table">
		<colgroup>
			<col width="40px" />
			<col width="250px" />
			<col width="150px" />
			<col width="150px" />
		</colgroup>

		<thead>
			<tr>
				<th>选择</th>
				<th>标题</th>
				<th>时间</th>
				<th>操作</th>
			</tr>
		</thead>

		<tbody>
			{set:$page=(isset($_GET['page'])&&(intval($_GET['page'])>0))?intval($_GET['page']):1;}
			{query: name=seller_message page=$page}
			<tr>
				<td><input name="check[]" type="checkbox" value="{$item['id']}" /></td>
				<td>{$item['title']}</td>
				<td>{$item['time']}</td>
				<td>
					<a href="{url:/comment/seller_message_show/id/$item['id']}"><img class="operator" src="{skin:images/admin/icon_check.gif}" title="查看" /></a>
					<a href="javascript:void(0)" onclick="delModel({link:'{url:/comment/seller_message_del/check/$item[id]}'})"><img class="operator" src="{skin:images/admin/icon_del.gif}" alt="删除" /></a>
				</td>
			</tr>
			{/query}
		</tbody>
	</table>
</div>
{$query->getPageBar()}
</form>

<script language="javascript">
//发送短消息
function sendMessage()
{
	art.dialog.open('{url:/comment/seller_message_send}',{
		'id':'sendWindow',
		'title':'商户消息',
		'width':'790px',
		'ok':function(iframeWin, topWin)
		{
			var iframeObj = $(iframeWin.document);
			var toSeller  = art.dialog.data('toSeller');
			if(toSeller)
			{
				iframeObj.find('[name="toSeller"]').val(toSeller);
			}
			iframeWin.kindEditorObj.sync();
			iframeObj.find('form').submit();
			return false;
		}
	});
}

//发送短消息后回调
function startMessageCallback(isSuccess)
{
	if(isSuccess == 1)
	{
		tips('发送消息成功');
		setTimeout(function(){
			window.location.reload();
		},1200);
	}
	else
	{
		alert('请填写标题和内容');
	}
	art.dialog({'id':'sendWindow'}).close();
}

//筛选商户回调函数
function searchSellerCallback(sellerIds)
{
	var defaultText = '默认为所有商户';
	if(sellerIds)
	{
		defaultText = '<label class="green">已选择部分商户</label>';
	}
	art.dialog.data('toSeller',sellerIds);
	art.dialog({'id':'sellerCondition'}).close();
	var openerObj = art.dialog({'id':'sendWindow'}).iframe.contentWindow.document.body;
	$(openerObj).find("#queryString").html(defaultText);
}
</script>